<template>
  <div>
    <div class="comment_cont">
      <div class="comment_list">
        <div class="comment_num">本次活动用户评论（共{{ list.length }}条）：</div>
        <div class="line"></div>
        <div class="item_feedback" v-for="(item, index) in list" :key="index">
          <img :src="item.avatar" alt="" class="user_img" />

          <div>
            <div class="user_name">{{ item.user_name }}</div>
            <div class="user_comment">
              {{ item.content }}
            </div>
            <div class="comment_time">{{ convertTimestampToDateTime(item.time) }}</div>
          </div>
        </div>
      </div>
      <div class="no_data_txt">-- 暂无更多评论 --</div>
    </div>
    <div class="footer_box">
      <input type="text" placeholder="参与回复" v-model="replyValue" />
      <div class="send_btn" @click="toSend">发送</div>
    </div>
  </div>
</template>

<script>
import { convertTimestampToDateTime } from "@/utils/time";
export default {
  props: {
    list: {
      type: Array,
      default: ''
    }
  },
  data() {
    return {
      pageSize: 10,
      page: 1,
      replyValue: ''
    }
  },
  created() {
  },
  methods: {
    convertTimestampToDateTime,
    //发送评论 
    toSend() {
      this.$emit('send', this.replyValue)
      this.replyValue = ''
    }
  }
}
</script>

<style lang="less" scoped>
.comment_list {
  background: #ffffff;
  border-radius: 6.67px;
  padding: 14px 10px 23px 10px;
  color: #333333;
}

.comment_cont {
  padding: 0 10px;
}

.comment_num {
  font-size: 12px;
  color: #333333;
}

.line {
  border-bottom: 0.33px solid #dddddd;
  margin: 13.33px 0 20px;
}

.item_feedback {
  display: flex;
  margin-bottom: 33px;

  &:last-child {
    margin: 0;
  }
}

.user_img {
  width: 40px;
  height: 40px;
  margin-right: 14.33px;
  border-radius: 50%;
}

.user_name {
  color: #00aeff;
  font-size: 14.67px;
  line-height: 14.67px;
}

.user_comment {
  line-height: 24px;
  font-size: 13.33px;
  margin: 15.3px 0 16.67px;
}

.comment_time {
  color: #333333;
  opacity: 0.5;
  font-size: 12px;
  line-height: 12px;
}

.no_data_txt {
  color: #555555;
  font-size: 10.67px;
  margin: 33px 0 93px;
  text-align: center;
}

.footer_box {
  position: fixed;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 60px;
  background: #ffffff;
}

input {
  width: 260px;
  height: 36.67px;
  background: rgba(247, 247, 247, 0.97);
  border-radius: 6.67px;
  padding: 0 10px;
  border: 0;
  font-size: 14px;
}

.send_btn {
  width: 66.67px;
  height: 36.67px;
  background: linear-gradient(0deg, #ffffff -20%, rgba(255, 255, 255, 0) 20%),
    #00aeff;
  border-radius: 6.67px;
  text-align: center;
  color: #ffffff;
  font-size: 14px;
  line-height: 36.67px;
  margin-left: 6.67px;
}
</style>